package java_thinking.unit_11._11_11;

import java.util.PriorityQueue;

/**
 * @Description : 验证空对象是无法插入到PriorityQueue
 * @author: cww
 * @DateTime: 2019-03-18 22:38
 */
class Dummy {}
class E29 {
    public static void main(String[] args) {
        PriorityQueue<Dummy> priorityQueue = new PriorityQueue<Dummy>();
        System.out.println("Adding 1st instance...");
        //java.lang.ClassCastException
        priorityQueue.offer(new Dummy());
        System.out.println("Adding 2nd instance...");
        priorityQueue.offer(new Dummy());
    }
}
